package com.jjyu.service.impl;

import com.jjyu.SurpriseMealApplication;
import com.jjyu.dao.FavoriteMapper;
import com.jjyu.dao.RestaurantMapper;
import com.jjyu.entity.Favorite;
import com.jjyu.entity.Restaurant;
import com.jjyu.entity.User;
import com.jjyu.service.FavoriteService;
import com.jjyu.service.RestaurantService;
import com.jjyu.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

import static org.junit.jupiter.api.Assertions.*;

@SpringBootTest(classes = SurpriseMealApplication.class)
class test {
    @Autowired
    private FavoriteService favaurateService;

    @Autowired
    private FavoriteMapper favoriteMapper;

    @Autowired
    private UserService userService;

    @Autowired
    private RestaurantMapper restaurantMapper;

    @Test
    void insert() {
        userService.register("夏小柿","xxs@123","123456");
        Restaurant restaurant = new Restaurant();
        restaurant.setRestaurantId(2);
        restaurant.setName("cg1");
        restaurant.setAddress("北京");
        restaurant.setRating(9.2);
        restaurantMapper.insert(restaurant);
//        Favorite favorite = new Favorite();
//        favorite.setId(1);
//        favorite.setUserId(1);
//        favorite.setRestaurantId(1);
//        favoriteMapper.insert(favorite);
    }
}